package com.cmz.common.utils;

import com.cmz.common.consts.CommonConsts;
import lombok.extern.slf4j.Slf4j;

/**
 * 操作系统信息工具
 * @author cmz
 */
@Slf4j
public class OsUtils {

    private OsUtils() {}

    public static final String DEFAULT_ENCODING;

    private static final String WINDOWS = "windows";

    static {
        String osname = System.getProperty("os.name");

        if (osname.toLowerCase().contains(WINDOWS)) {
            DEFAULT_ENCODING = CommonConsts.ENCODING_GBK;
        } else {
            DEFAULT_ENCODING = CommonConsts.ENCODING_UTF8;
        }
    }

}
